<?php
/**
 * @Auth: JH <hu@lunaz.cn>
 */

spl_autoload_register( function ( $class ) {
    if (substr( $class, 0, 3 ) == 'lib') {
        $class = str_replace( array('/', '\\'), DIRECTORY_SEPARATOR, $class );
        $file = dirname( __DIR__ ) . DIRECTORY_SEPARATOR . $class . '.php';
        if (is_readable( $file )) {
            require $file;
        }
    }
}, true, true );